# Maintainer: Michael Aldridge <maldridge@voidlinux.org>
pkgname=musl-nscd
pkgver=1.1.1
pkgrel=0
pkgdesc="Implementation of nscd for nsswitch modules for musl"
url="https://github.com/pikhq/musl-nscd"
arch="all"
options="!check" # no test suite
license="MIT"
depends_dev="bison flex"
makedepends="$depends_dev"
install="$pkgname.pre-install"
subpackages="$pkgname-dev $pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/pikhq/musl-nscd/archive/v$pkgver.tar.gz
	musl-nscd.initd
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install

	install -m644 -D COPYRIGHT \
		"$pkgdir"/usr/share/licenses/$pkgname/COPYRIGHT

	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/nscd
}

sha512sums="f067b1491c6c46c3070aa2f61328b874eb6ad390c2efc928e2fee591ef5997b40400e29495546a861e803460efa46024c7a01c53ddae5b763ef63c2f274fceea  musl-nscd-1.1.1.tar.gz
c2e555527cc3d2692b91dbdd2d94ea9f2db7dcc923423517c0aa33869f48e91c84f5d2437d9d278d97b4b2e878d84414f066168d554034bfaab9ae5f8ef73772  musl-nscd.initd"
